import Vue from 'vue';
import Router from 'vue-router';
import Login from '../components/entrance/item-login.vue';
import ForgetPSW from '../components/entrance/item-forget-PSW.vue';
import Register from '../components/entrance/item-register.vue';
import Tip from '../components/comp/comp-tip.vue';
import Index from '../components/index/item-index.vue';
import IndexQueryOrderByLicence from '../components/index/item-index-query-order-by-licence.vue';
import IndexFinishedOrders from '../components/index/item-index-finished-orders';
import IndexCheckInfoConfirm from '../components/index/item-index-check-info-confirm.vue';
import IndexIntroduce from '../components/index/item-index-introduce.vue';
import Choose from '../components/choose/item-choose.vue';
import LicenceQuery from '../components/comp/licence-query.vue';
import News from '../components/news/item-news.vue';
import NewsType from '../components/news/item-news-type.vue';
import NewsDetail from '../components/news/item-news-detail.vue';
import Mine from '../components/mine/item-mine.vue';
import MineMessage from '../components/mine/item-mine-message.vue';
import MineMessageList from '../components/mine/item-mine-message-list.vue';
import MineAchievement from '../components/mine/item-mine-achievement.vue';
import MineOrders from '../components/mine/item-mine-orders.vue';
import MineOrderPending from '../components/mine/item-mine-order-pending.vue';
import MineOrderDetail from '../components/mine/item-mine-order-detail.vue';
import MineOrderDetailOwner from '../components/mine/item-mine-order-detail-owner.vue';
import MineOrderDetailCar from '../components/mine/item-mine-order-detail-car.vue';
import MineTeam from '../components/mine/item-mine-team.vue';
import MineTeamAchievement from '../components/mine/item-mine-team-achievement.vue';
import MineInvite from '../components/mine/item-mine-invite.vue';
import MineCode from '../components/mine/item-mine-code.vue';
import MineSet from '../components/mine/item-mine-set.vue';
import MineProfit from '../components/mine/item-mine-profit.vue';
import MineProfitDetail from '../components/mine/item-mine-profit-detail.vue';
import MineWithdraw from '../components/mine/item-mine-withdraw.vue';
import MineWithdrawDetail from '../components/mine/item-mine-withdraw-detail.vue';
import FillOwnerInfo from '../components/comp/comp-fill-owner-info.vue';
import FillCarInfo from '../components/comp/comp-fill-car-info.vue';
import FillInsurancePolicy from '../components/comp/comp-fill-insurance-policy.vue';
import FillInsuranceDetail from '../components/comp/comp-fill-insurance-detail.vue';
import FillInsuranceCar from '../components/comp/comp-fill-insurance-car.vue';
import PayInsuranceOffer from '../components/comp/comp-pay-insurance-offer.vue';
import PayInsuranceOfferCompare from '../components/comp/comp-pay-insurance-offer-compare.vue';
import PayInsuranceDetailConfirm from '../components/comp/comp-pay-insurance-detail-confirm.vue';
import PayInsuranceRatio from '../components/comp/comp-pay-insurance-ratio.vue';
import PayInsuranceInfoConfirm from '../components/comp/comp-pay-insurance-info-confirm.vue';
import PayInsuranceFinal from '../components/comp/comp-pay-insurance-final.vue';
import NewAccount from '../components/comp/comp-new-account.vue';
import BankAccountList from '../components/comp/comp-bank-account-list.vue';
import Test from '../components/comp/_test.vue'


Vue.use(Router);

/* 开启debug模式 */
Vue.config.debug = true;

export default new Router({
  routes: [
    {
      path: '/test',
      name: 'test',
      component: Test
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/forgetPSW',
      name: 'ForgetPSW',
      component: ForgetPSW
    },
    {
      path: '/register/:id',
      name: 'Register',
      component: Register
    },
    {
      path: '/tip/:type',
      name: 'Tip',
      component: Tip
    },
    {
      path: '/',
      name: 'Index',
      component: Index,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/index/query-order-by-licence',
      name: 'IndexQueryOrderByLicence',
      component: IndexQueryOrderByLicence,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/index/finished-orders',
      name: 'IndexFinishedOrders',
      component: IndexFinishedOrders,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/index/index-check-info-confirm/:type/:id/:car_id',
      name: 'IndexCheckInfoConfirm',
      component: IndexCheckInfoConfirm,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/index/introduce/:id',
      name: 'IndexIntroduce',
      component: IndexIntroduce
    },
    {
      path: '/choose',
      name: 'Choose',
      component: Choose,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/licence-query',
      name: 'LicenceQuery',
      component: LicenceQuery,
      props: {
        type: 'queryInfo'
      },
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/news',
      name: 'News',
      component: News,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/news/news-type/:type',
      name: 'NewsType',
      component: NewsType,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/news/news-detail/:id',
      name: 'NewsDetail',
      component: NewsDetail,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine',
      name: 'Mine',
      component: Mine,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-message',
      name: 'MineMessage',
      component: MineMessage,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-message-list',
      name: 'MineMessageList',
      component: MineMessageList,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-achievement',
      name: 'MineAchievement',
      component: MineAchievement,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-orders',
      name: 'MineOrders',
      component: MineOrders,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-order-pending/:order_id/:status',
      name: 'MineOrderPending',
      component: MineOrderPending,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-order-detail/:order_id/:status',
      name: 'MineOrderDetail',
      component: MineOrderDetail,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-order-detail-owner/:type/:car_owner_id',
      name: 'MineOrderDetailOwner',
      component: MineOrderDetailOwner,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-order-detail-car/:type/:car_id',
      name: 'MineOrderDetailCar',
      component: MineOrderDetailCar,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-team',
      name: 'MineTeam',
      component: MineTeam,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-team-achievement',
      name: 'MineTeamAchievement',
      component: MineTeamAchievement,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-invite',
      name: 'MineInvite',
      component: MineInvite,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-code',
      name: 'MineCode',
      component: MineCode,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-set',
      name: 'MineSet',
      component: MineSet,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-profit',
      name: 'MineProfit',
      component: MineProfit,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-profit-detail/:type',
      name: 'MineProfitDetail',
      component: MineProfitDetail,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-withdraw',
      name: 'MineWithdraw',
      component: MineWithdraw,
      meta: {
        requireAccount: true,
        requireAuth: true
      }
    },
    {
      path: '/mine/mine-withdraw-detail',
      name: 'MineWithdrawDetail',
      component: MineWithdrawDetail,
      meta: {
        requireAccount: true,
        requireAuth: true
      }
    },
    {
      path: '/fill-owner-info',
      name: 'FillOwnerInfo',
      component: FillOwnerInfo,
      props: {
        type: 'page',
        editable: true
      },
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/fill-car-info/:type/:id',
      name: 'FillCarInfo',
      component: FillCarInfo,
      props: {
        type: 'page',
        editable: true
      },
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/fill-insurance-policy/:type/:car_owner_id/:car_id',
      name: 'FillInsurancePolicy',
      component: FillInsurancePolicy,
      props: {
        type: 'page',
        editable: true
      },
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/fill-insurance-detail/:type/:car_owner_id/:car_id/:policy_id',
      name: 'FillInsuranceDetail',
      component: FillInsuranceDetail,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/fill-insurance-car/:type/:car_owner_id/:car_id/:policy_id/:in_id',
      name: 'FillInsuranceCar',
      component: FillInsuranceCar,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/pay-insurance-offer/:type/:car_owner_id/:car_id/:policy_id/:in_id',
      name: 'PayInsuranceOffer',
      component: PayInsuranceOffer,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/pay-insurance-offer-compare',
      name: 'PayInsuranceOfferCompare',
      component: PayInsuranceOfferCompare,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/pay-insurance-detail-confirm/:type/:car_owner_id/:car_id/:policy_id/:in_id',
      name: 'PayInsuranceDetailConfirm',
      component: PayInsuranceDetailConfirm,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/pay-insurance-ratio/:order_id',
      name: 'PayInsuranceRatio',
      component: PayInsuranceRatio,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/pay-insurance-info-confirm/:type/:company_id/:order_id',
      name: 'PayInsuranceInfoConfirm',
      component: PayInsuranceInfoConfirm,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/pay-insurance-final/:company_id/:order_id/:order_pay_id',
      name: 'PayInsuranceFinal',
      component: PayInsuranceFinal,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/new-account',
      name: 'NewAccount',
      component: NewAccount,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/bank-account-list',
      name: 'BankAccountList',
      component: BankAccountList,
      meta: {
        requireAuth: true
      }
    }
  ]
})
